<template>
	<view>
		<view class="shop_list" v-if="holetList.length>=1">
			<scroll-view :scroll-y="true" class="shop_mian" >						
				<view  class="shop_title" @click="clickHolet(item)" v-for="(item,index) in holetList" :key="index">
				  {{item.title}}
				</view>						
			</scroll-view>					
		</view>
	</view>
</template>

<script>
	import sun from '@/utils/sun.js'
	export default {
		props:{
			value:{
				type:String,
				default:''
			}
		},
		data() {
			return {
				holetList:''
			};
		},
		mounted() {
			
		},
		watch:{
			'value':function(newValue,old){								
				   this.hotelName({title:newValue})					
			}
		},
		methods:{
			//进店记录
			hotelName(e){
			  let that=this			  	  
			  sun.request({
				url: "/h5/dictionary.hotel/index",
				// showLoading: true,
				token:true,
				data:{
					title:e.title
				},
				success(res) {				
					if(res.code==200){														
						that.holetList=res.data.hotelList
					}
				},
				fail(e) {
					uni.showToast({
						icon: "none",
						title: "服务器开小差去啦~",
					})
				}
			  })						  
			},
			clickHolet(item){
				this.$emit('clickHolet',item)
			}
		}
	}
</script>

<style lang="less">

//门店列表弹框
.shop_list:after{ 
	content:""; 
	width: 0; 
	height: 0; 
	border: 7px solid transparent;
	border-bottom-color:#f4f4f4; 
	position: absolute;
	left: 10px;
	top:-14px;
}
.shop_list{
	z-index: 99;
	max-height: 400upx;	
	padding: 20upx;
	position: absolute;
	left: 90px;
	top: 50px;
	background: #f4f4f4;
	border-radius: 10upx;
	.shop_mian{
		max-height: 200upx;
		width: 100%;
		font-size: 28upx;		
		.shop_title{
			padding: 10upx 0;
			border-bottom: 1upx solid #CCCCCC;
		}
	}
}
</style>
